<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>The Sandbox</title>
        <style type="text/css">
        	#canvas
        	{
        		border: dotted 3px red;
        	}
        </style>
    </head>
    <body bgcolor="black">
    	<center>
        <h1><font color="Red">Bloop</font></h1>
        <canvas id="canvas" width="800" height="600">Your browser does not support canvas.</canvas>
        </center>
        <script language="JavaScript" src="game.js">
		</script>
		<script>
		//WIDTH and HEIGHT need to be changed according to canvas size
		//and they need to be changed in game.js
		var shooting = false;
		var shootCount;
		var WIDTH = 800;
		var HEIGHT = 600;
		var i = 0;
		var charName = "null";
		var isGame = false;

		function init()
		{
			canvas = document.getElementById("canvas");
			ctx = canvas.getContext("2d");
			return setInterval("draw(isGame, charName)", drawInt);
		}
		function onClick(ev)
		{
			canvas = document.getElementById("canvas");
			var clickX = ev.clientX - canvas.offsetLeft;
			var clickY = ev.clientY - canvas.offsetTop;
			if(!isGame)
			{
				if(clickX > 100 && clickX < 300 && clickY > 100 && clickY < 150)
				{
					charName = "Bloop";
					isGame = true;
				}
				else if(clickX > 100 && clickX < 300 && clickY > 200 && clickY < 250)
				{
					charName = "Oswald";
					isGame = true;
				}
				else if(clickX > 100 && clickX < 300 && clickY > 300 && clickY < 350)
				{
					charName = "Brian";
					isGame = true;
				}
				else if(clickX > 100 && clickX < 300 && clickY > 400 && clickY < 450)
				{
					charName = "Steven";
					isGame = true;
				}
			}
			else
			{
				if(charName == "Bloop")
					swing(clickX, clickY);
				//shoot(clickX, clickY);			PUT ON HOLD
			}
		}
		init();
		window.addEventListener('click', onClick, false);
		window.addEventListener('keydown',doKeyDown,true);
		window.addEventListener('keyup',doKeyUp,true);

        </script>
    </body>
</html>